$(function(){
	   easyloader.base = 'js/tools/easyui/';
	   using("locale/easyui-lang-zh_CN.js",function(){
	      var columns=[[
	                             {field:'checkbox',checkbox:true},
								  {field: 'id',title: 'id',hidden:true},
						          {field: 'name',title: '路名',width: 150,align: 'left'},
								  {field: 'opt',title: '操作',width: 120,align: 'left'}
								 
							 ]];
	         createDateGrid(columns,'',{},false,560);
	   });
	  provinceList("provinceId");
});

//删除用户
function deleteLoads(ids)
{
	$.getJSON("dic!deleteLoads.action",{"ids":ids},function(data){
		       if(data.info)
					{
						$("#dataGrid").datagrid("reload");
						alert("删除成功");
					}else
					{
						alert("删除失败");
					}
	});
}

//搜索
function searchData()
{
	var provinceId=$("#provinceId").val();
	var cityId=$("#cityId").val();
	var countiesId=$.trim($("#countiesId").val());
	if(countiesId.length=="")
	{
		alert("请选择路名!");
		return false;
	}
    var queryParams = $('#dataGrid').datagrid('options');  
        queryParams.queryParams = {provinceId:provinceId,cityId:cityId,countiesId:countiesId};  
		queryParams.url="dic!loadListForJson.action";
        $("#dataGrid").datagrid('reload'); 
}

//批量删除
function moreDelete()
{
	var rows= $("#dataGrid").datagrid("getSelections");
	var ids="";
	for(var i=0;i<rows.length;i++)
	{
		ids+=rows[i].id+",";
	}
	ids=ids.substring(0,ids.length-1);
	deleteBusiness(ids);
}
